#include "cocos2d.h"
#include "cocos-ext.h"
#include "Tree.h"
#include "SimpleAudioEngine.h"
#include "Config.h"

USING_NS_CC;
USING_NS_CC_EXT;

Tree::Tree()
{
	initWithFile("daucay.png");

    mIsChoose = false;
	mBranch = new Branch();
	mTopSide = 0;
}

void Tree::fAssemblyBodyTree()
{
	CCSprite* nSprite = CCSprite::create("thancay.png");
	nSprite->setPosition(ccp(this->getContentSize().width/2,-nSprite->getContentSize().height/2 + mTopSide));
	nSprite->addComponent(new TreeComponent());
	this->addChild(nSprite);
	mTopSide -= nSprite->getContentSize().height;
}

void Tree::fAssemblyEndTree()
{
	CCSprite* nSprite = CCSprite::create("mTopSidecay.png");
	nSprite->setPosition(ccp(this->getContentSize().width/2,-nSprite->getContentSize().height/2 + mTopSide));
	nSprite->addComponent(new TreeComponent());
	this->addChild(nSprite);
	mTopSide -= nSprite->getContentSize().height;
}

